package cn.xopencode.recordservice.convert.meterroom;

import cn.xopencode.common.framework.vo.PageResult;
import cn.xopencode.recordservice.dal.mysql.dataobject.meterroom.MeterRoomRecordDO;
import cn.xopencode.recordservice.dal.mysql.dataobject.meterroom.MeterRoomRecordEmpRelDO;
import cn.xopencode.recordservice.rpc.meterroom.dto.MeterRoomRecordCreateDTO;
import cn.xopencode.recordservice.rpc.meterroom.dto.MeterRoomRecordPageDTO;
import cn.xopencode.recordservice.rpc.meterroom.dto.MeterRoomRecordUpdateDTO;
import cn.xopencode.recordservice.rpc.meterroom.vo.MeterRoomRecordEmpRelVO;
import cn.xopencode.recordservice.rpc.meterroom.vo.MeterRoomRecordPageVO;
import cn.xopencode.recordservice.rpc.meterroom.vo.MeterRoomRecordUpdateVO;
import cn.xopencode.recordservice.service.meterroom.bo.MeterRoomRecordCreateBO;
import cn.xopencode.recordservice.service.meterroom.bo.MeterRoomRecordPageBO;
import cn.xopencode.recordservice.service.meterroom.bo.MeterRoomRecordUpdateBO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface MeterRoomRecordConvert {

    MeterRoomRecordConvert INSTANCE = Mappers.getMapper(MeterRoomRecordConvert.class);

    @Mapping(source = "records",target = "list")
    PageResult<MeterRoomRecordPageVO> convert(IPage<MeterRoomRecordDO> recordDOIPage);

    List<MeterRoomRecordEmpRelVO> convert(List<MeterRoomRecordEmpRelDO> doList);

    MeterRoomRecordPageBO convert(MeterRoomRecordPageDTO pageDTO);

    MeterRoomRecordUpdateVO convert(MeterRoomRecordDO recordDO);

    MeterRoomRecordCreateBO convert(MeterRoomRecordCreateDTO createDTO);

    MeterRoomRecordDO convert(MeterRoomRecordCreateBO createBO);

    MeterRoomRecordUpdateBO convert(MeterRoomRecordUpdateDTO updateDTO);

    MeterRoomRecordDO convert(MeterRoomRecordUpdateBO updateBO);

}
